
package com.treeman.navi.map;

import android.content.Context;
import android.util.AttributeSet;

import com.google.android.maps.MapView;


public class CustomMapView extends MapView
{

    @SuppressWarnings ("unused")
    private static String TAG = "CustomMapView";
    private Context context = null;

    // MAP TYPES

    public static int TYPE_NORMAL = 0;
    public static int TYPE_SATELLITE = 1;

    // TIME

    private int startTime = 0;
    private int endTime = 0;

    private int longTouchTime = 1000;

    // LISTENERS

    OnTouchFreezeListener onTouchListener = null;


    public CustomMapView(Context context, String apiKey)
    {
	super(context, apiKey);
	initializeMapView();
    }

    public CustomMapView(Context context, AttributeSet attrs)
    {
	super(context, attrs);
	this.context = context;
	initializeMapView();
    }

    public CustomMapView(Context context, AttributeSet attrs, int defStyle)
    {
	super(context, attrs, defStyle);
	initializeMapView();
    }

    private void initializeMapView()
    {
	// INICJALIZACJA

	startTime = (int) System.currentTimeMillis();
	endTime = (int) System.currentTimeMillis();

	setType(CustomMapView.TYPE_NORMAL);
    }

    public void setType(int type)
    {
	switch (type)
	{
	    case 0:
		this.setSatellite(false);
		return;
	    case 1:
		this.setSatellite(true);
		return;
	}
	return;
    }

    public void setLongTouchTime(int time)
    {
	this.longTouchTime = time;
    }

    public int getLongTouchTime()
    {
	return this.longTouchTime;
    }


    public interface OnTouchFreezeListener
    {

	public abstract void onTouchFreezeTimeChanged(int currentTime);

    }

}
